package com.zmj.sy.mom.srv.aps.bean.bo;

import com.zmj.sy.mom.srv.aps.bean.entity.order.ApsWorkDetail;
import com.zmj.sy.mom.srv.aps.bean.entity.order.ApsWorkOrder;
import com.zmj.sy.mom.srv.aps.utils.Comment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class ApsTask extends ApsStep {

    private Integer id;

    @Comment("消费状态 1未消费 2部分消费 3全部消费")
    private Integer consumerStatus;

    @Comment("消费数量")
    private BigDecimal consumerCount;

    @ApiModelProperty("状态 1-不排产 2-可排产 3-排产中 4-可重排 5-排产完成")
    private Integer status;

    private ApsWorkDetailTemp apsWorkDetailTemp;

    private ApsWorkOrderTemp apsWorkOrderTemp;

    private ApsWorkOrder apsWorkOrder;

    private final ApsWorkDetail apsWorkDetail;

    private List<ApsWeekDay> startMachineCalendar = new ArrayList<>();

    private List<ApsWeekDayWrap> all = new ArrayList<>();

    private Integer appendFlag;

    public ApsTask(ApsWorkDetail dw){
        apsWorkDetail = dw;
    }

    @Override
    public LocalDateTime getEndTime() {
        return apsWorkDetail.getPlanEndDateTime();
    }

    public Integer getApsWorkOrderId() {
        return apsWorkDetail.getApsWorkOrderId();
    }

    public Integer getApsWorkOrderPid() {
        return apsWorkDetail.getApsWorkOrderPid();
    }

    public Integer getPhaseSeq() {
        return apsWorkDetail.getPhaseSeq();
    }

    public LocalDateTime getPlanEndDateTime() {
        return apsWorkDetail.getPlanEndDateTime();
    }

    public LocalDateTime getPlanStartDateTime() {
        return apsWorkDetail.getPlanStartDateTime();
    }

    public String getGroupCode() {
        return apsWorkDetail.getGroupCode();
    }

    public String getPhaseCode() {
        return apsWorkDetail.getPhaseCode();
    }
}
